package com.mmp.main.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * The persistent class for the lookup_device_category database table.
 *
 */
@Entity
@Table(name = "lookup_device_category")
@NamedQuery(name = "LookupDeviceCategory.findAll", query = "SELECT l FROM LookupDeviceCategory l WHERE l.status=true ORDER BY l.name ")
public class LookupDeviceCategory implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Basic(optional = false)
	private Integer id;

	private String name;

	private Boolean status;

	// bi-directional many-to-one association to HospitalDevice
	@OneToMany(mappedBy = "lookupDeviceCategory")
	private List<HospitalDevice> hospitalDevices;

	public LookupDeviceCategory() {
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Boolean getStatus() {
		return this.status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}

	public List<HospitalDevice> getHospitalDevices() {
		return this.hospitalDevices;
	}

	public void setHospitalDevices(List<HospitalDevice> hospitalDevices) {
		this.hospitalDevices = hospitalDevices;
	}

	public HospitalDevice addHospitalDevice(HospitalDevice hospitalDevice) {
		getHospitalDevices().add(hospitalDevice);
		hospitalDevice.setLookupDeviceCategory(this);

		return hospitalDevice;
	}

	public HospitalDevice removeHospitalDevice(HospitalDevice hospitalDevice) {
		getHospitalDevices().remove(hospitalDevice);
		hospitalDevice.setLookupDeviceCategory(null);

		return hospitalDevice;
	}

}
